import { v4 as uuidv4 } from "uuid";
/**
 *
 * @param {*} data 初始模板
 */
export default function dellSymptopmJson(data) {
  const SymSubs = [];
  const SymS = [];
  data.forEach((item) => {
    const  symptomsubId  =  uuidv4();
    let symSubItem = {
      id: symptomsubId,
      title: item.title,
    };
    SymSubs.push(symSubItem);
    if(item.children&&item.children.length > 0 ){
        item.children.forEach(i=>{
             let symItem = {
                  id:uuidv4(),
                  title:i.title,
                  seen:i.seen,
                  tips:i.tips,
                  symptomsubId
             }
             SymS.push(symItem)
        })
    }
  });
  return {
    SymSubs,
    SymS,
  };
}
